import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-03-20
 * Time: 19:24
 */
class Rectangle {
    int width;
    int height;
    int area;
    int getLength (int width ,int heght,int area ) {
        return width * height;
    }
    void getArea (int width ,int heght,int area ) {
        System.out.println( width * height * area );
    }
}
class USER {
    String id;
    String password;
    String email;
}
/**
 * @author YKH
 */
public class EXERCISE {
    //6.定义一个用户类 ,包含的元素有用户ID
    static void message(String id, String passWord, String email) {
        System.out.print(id +" "+ passWord +" "+ email);
        System.out.println();
    }
    void message(String id,String password) {
        USER user = new USER();
        user.email = id + "@qq.com";
        System.out.print(id +" "+ password +" "+ user.email);
        System.out.println();
    }
    void message(String id) {
        USER user = new USER();
        user.password = "123456";
        user.email = id + "@qq.com";
        System.out.print(id +" "+ user.password +" "+ user.email);
        System.out.println();
    }
    public static void main9(String[] args) {
        USER user = new USER();
        user.id = "123456";
        user.password = "654321";
        user.email = "987654321@qq.com";
        message (user.id,user.password,user.email);
    }

    //5.有三个方法，分别实现返回姓名和两门课成绩（总分），
    // 返回姓名和三门课成绩（总分），返回姓名和五门课成绩（总分）。
    // 封装成一个可变参数的方法。（YJP

    //4、从键盘输入一个整型数组，并求其最大值
    public static void main5(String[] args) {
        Scanner scan = new Scanner( System.in);
        int []arr = new int[10];
        for (int i = 0; i <10; i++) {
            arr[i] = scan.nextInt();
        }
        int max = arr[0];
        for (int i = 0; i < 10; i++) {
            if( arr[i] > max) {
                max = arr[i];
            }
        }
        System.out.println("最大值" + max);
    }
    //2、设计Rectangle类
    public static void main4(String[] args) {
        Rectangle ret = new Rectangle();
        ret.width = 10;
        ret.height = 20;
        ret.area = 30;
        System.out.println(ret.getLength(ret.width, ret.height, ret.area));
        ret.getArea ( ret.width, ret.height , ret.area );
    }
    //1、一个班级有2名学生，3门课程，使用二维数组保存每门课的成绩，并计算每门课的总分和平均分。
    public static void main (String [] arr ) {
        Scanner scan = new Scanner(System.in);
        double sum = 0;
        int [][] score = new int[2][3];
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                score[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 2; i++) {
            sum = 0;
            for (int j = 0; j < 3; j++) {
                sum += score[i][j];
            }
            System.out.print("总分"+ sum+" ");
            System.out.println( "平均分"+sum/3);
        }
    }
    public static void main2(String[] args) {
        int [][] arr = { {1,2,3},{5,6,7,8}};
        for ( int [] ret : arr) {
            for ( int x: ret) {
                System.out.print(x + " ");
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        int a=10;
        int b=20;
        System.out.println( max(a,b ));
    }
    public static int max(int a, int b) {
        return a>b ? a:b;
    }
    public static int  max (double a,double b ){
        System.out.println("2");
        return a>b ? (int) a :(int) b;
    }
}
